import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.JPanel;

/**
 * 游戏关卡1
 * 
 * @author 烦得很
 */
public class GameLevel1 extends Rendering {
    private JPanel mainGamePanel;
    String mapString = "6666666666\n" +
            "6303030306\n" +
            "6433033036\n" +
            "6100004026\n" +
            "6003000306\n" +
            "6003300006\n" +
            "8000074006\n" +
            "6000300006\n" +
            "6003003906\n" +
            "6666666666";

    /**
     * level1的所有事件
     */
    public static enum mapEventAreaAndIndex {
        playerHouse,
        unfinedHouse, 
        npc1House,
        enermy1,
        enermy2;

        /**
         * 所有区域的坐标
         */
        /* 注意顺序必须与枚举顺序一致 */
        public static int[][][] mapEventArea = new int[][][] {
                { { 1, 1, 1 } },
                { { 1, 2, 6 } },
                { { 1, 5, 6 } },
                { { 1, 1, 8 } },
                { { 1, 7, 8 } }
        };
    }

    /**
     * 初始化关卡1
     */
    public GameLevel1() {
        super("Level 1");
        GameManager.nowPlayerLevel = 1;
        init();
    }

    /**
     * 初始化游戏
     */
    @Override
    public void init() {
        iniMapArrayByAllNum(mapString, 10);
        mainGamePanel = new JPanel();
        mainGamePanel.setLayout(new GridLayout(gameMapWidth, gameMapHeight));
        mainGamePanel.setBounds(drawMainGamePanelWidthStartX, 10, drawMainGamePanelMaxWidth - 10,
                drawMainGamePanelWidthEndY - 10);
        mainGamePanel.setBackground(Color.BLACK);
        iniMapArea(mainGamePanel);
        gameLevelFrme.add(mainGamePanel);
    }
}